package com.huaxin.device.dto.request;

import com.huaxin.device.dto.enums.validation.ValidAlarmLevel;
import com.huaxin.hxenum.validation.ValidDeviceType;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

@Data
public class AlarmThresholdTemplateUpdateReqDTO {

    /**
     * 模板ID（必填）
     */
    @NotBlank(message = "ID不能为空")
    @Schema(description = "模板ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "123e4567-e89b-12d3-a456-426614174000")
    private String id;

    /**
     * 模板名称
     */
    @NotBlank(message = "模板名称不能为空")
    @Schema(description = "模板名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "断路器标准阈值")
    private String templateName;

    /**
     * 设备类型
     */
    @Schema(description = "设备类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "circuit_breaker")
    @NotNull(message = "设备类型不能为空")
    @ValidDeviceType
    private String deviceType;

    /**
     * 绑定的设备型号ID（可选）
     */
    @Schema(description = "绑定的设备型号ID", example = "550e8400-e29b-41d4-a716-446655440000")
    private String modelId;

    /**
     * 默认报警等级
     */
    @Schema(description = "默认报警等级", requiredMode = Schema.RequiredMode.REQUIRED, example = "3")
    @NotNull(message = "报警等级不能为空")
    @ValidAlarmLevel
    private Integer alarmLevel;

    /**
     * 报警消息模板
     */
    @Schema(description = "消息模板", example = "设备{{deviceName}}的{{alarmLevel}}报警")
    private String messageTemplate;

    /**
     * 描述
     */
    @Schema(description = "描述", example = "适用于标准断路器的通用报警阈值配置")
    private String description;

    /**
     * 组织家族ID
     */
    @Schema(description = "组织家族ID", example = "f3b2f8e1-4c5d-4e6f-8b2a-1c2d3e4f5a6b")
    private String familyId;
}